package com.hsteach.web.controller.equipment.sdk;

import com.hsteach.common.annotation.Anonymous;
import com.hsteach.common.core.controller.BaseController;
import com.hsteach.common.core.domain.AjaxResult;
import com.hsteach.service.buildingApply.BuildingApplySdkService;
import com.hsteach.service.equipment.EquipmentSdkService;
import com.hsteach.web.controller.equipment.sdk.dto.SumEquipmentDto;
import com.hsteach.web.controller.equipment.sdk.vo.SumEquipmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 设备报修外部接口
 * 
 * @author fanxquer
 * @date 2023-07-07
 */
@Api(value = "设备报修外部接口", tags = "设备报修外部接口")
@RestController
@RequestMapping("/sdk/equipment")
public class EquipmentSdkController extends BaseController
{
    @Autowired
    private EquipmentSdkService equipmentSdkService;

    /**
     * 查询设备报修总数
     */
    @ApiOperation("查询设备报修总数")
    @Anonymous
    @PostMapping("/sumRepair")
    public AjaxResult sumRepair(HttpServletRequest request, @RequestBody @Validated SumEquipmentDto dto)
    {
        Long aLong = equipmentSdkService.sumRepair(dto.getOrgCode());
        SumEquipmentVo vo = new SumEquipmentVo();
        vo.setSumRet(aLong);
        return AjaxResult.success(vo);
    }

}
